<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>
<html>
<head>
    <title>用户订单管理管理</title>
    <meta name="decorator" content="default"/>
    <script type="text/javascript">
        $(document).ready(function () {
            $(document).ready(function () {
                $("#btnExport").click(function () {
                    top.$.jBox.confirm("确认要导出用户订单数据吗？", "系统提示", function (v, h, f) {
                        if (v == "ok") {
                            $("#searchForm").attr("action", "${ctx}/shop/shop/hkShopUserOrderWithraw/export");
                            $("#searchForm").submit();
                        }
                    }, {buttonsFocus: 1});
                    top.$('.jbox-body .jbox-icon').css('top', '55px');
                });
                $("#btnImport").click(function () {
                    $.jBox($("#importBox").html(), {
                        title: "导入数据", buttons: {"关闭": true},
                        bottomText: "导入文件不能超过5M，仅允许导入“xls”或“xlsx”格式文件！"
                    });
                });
            });
        });

        function page(n, s) {
            $("#pageNo").val(n);
            $("#pageSize").val(s);
            $("#searchForm").submit();
            return false;
        }


        function updateWithrawByOrderNumber(ordernumber) {

        }

    </script>
</head>
<body>
<ul class="nav nav-tabs">
    <li class="active"><a href="${ctx}/shop/shop/hkShopUserOrderWithraw/">用户订单管理列表</a></li>
</ul>
<form:form id="searchForm" modelAttribute="hkShopUserOrderWithdraw" action="${ctx}/shop/shop/hkShopUserOrderWithraw/"
           method="post"
           class="breadcrumb form-search">
    <input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
    <input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
    <sys:tableSort id="orderBy" name="orderBy" value="${page.orderBy}" callback="page();"/>
    <ul class="ul-form">
        <li><label>订单号：</label>
            <form:input path="ordernumber" htmlEscape="false" maxlength="20" class="input-medium"/>
        </li>
        <li><label>订单状态：</label>
            <form:select path="state" class="input-medium">
                <form:option value="" label=""/>
                <form:options items="${fns:getDictList('hk_shop_order_state')}" itemLabel="label" itemValue="value"
                              htmlEscape="false"/>
            </form:select>
        </li>
       <%-- <li><label>成交时间：</label>
            <input name="confirmdate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
                   value="<fmt:formatDate value="${hkShopUserOrderWithraw.confirmdate}" pattern="yyyy-MM-dd"/>"
                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
        </li>--%>
        <li><label>下单时间：</label>
            <input name="beginCreateDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
                   value="<fmt:formatDate value="${hkShopUserOrderWithraw.beginCreateDate}" pattern="yyyy-MM-dd"/>"
                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> -
            <input name="endCreateDate" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
                   value="<fmt:formatDate value="${hkShopUserOrderWithraw.endCreateDate}" pattern="yyyy-MM-dd"/>"
                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
        </li>
        <li><label>收货人：</label>
            <form:input path="consignee" htmlEscape="false" maxlength="100" class="input-medium"/>
        </li>
        <li><label>手机号：</label>
            <form:input path="phone" htmlEscape="false" maxlength="20" class="input-medium"/>
        </li>
        <li><label>快递公司：</label>
            <form:input path="courier" htmlEscape="false" maxlength="50" class="input-medium"/>
        </li>
        <li><label>快递单号：</label>
            <form:input path="couriernumber" htmlEscape="false" maxlength="50" class="input-medium"/>
        </li>
        <li class="btns">
            <input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
                <%--<input id="btnExport" class="btn btn-primary" type="button" value="导出"/>--%>
        </li>
        <li class="clearfix"></li>
    </ul>
</form:form>
<sys:message content="${message}"/>
<table id="contentTable" class="table table-striped table-bordered table-condensed">
    <thead>
    <tr>
        <th>订单号</th>
        <th>提现金额(<font color="red">手续费1%</font>)</th>
        <th>用户</th>
        <th>收货人</th>
        <th>手机号</th>
        <th class="sort-column createDate">下单时间</th>
        <th class="sort-column delivertime">发货时间</th>
        <th class="sort-column confirmdate">成交时间</th>
        <th>售后状态</th>
        <shiro:hasPermission name="shop:order:hkShopUserOrder:edit">
            <th>操作</th>
        </shiro:hasPermission>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${page.list}" var="hkShopUserOrderWithraw">
        <tr>
                <%-- <td><a href="${ctx}/shop/shop/hkShopUserOrderWithdraw/form?id=${hkShopUserOrder.id}">
                         ${hkShopUserOrder.ordernumber}
                 </a></td>--%>
            <td>
                    ${hkShopUserOrderWithraw.ordernumber}
            </td>
            <td>
                    ￥ <font color="red">${hkShopUserOrderWithraw.payMoney}</font> 元
            </td>
            <td>
                    ${hkShopUserOrderWithraw.user.name}
            </td>
            <td>
                    ${hkShopUserOrderWithraw.consignee}
            </td>
            <td>
                    ${hkShopUserOrderWithraw.phone}
            </td>
            <td>
                <fmt:formatDate value="${hkShopUserOrderWithraw.createDate}" pattern="yyyy-MM-dd"/>
            </td>
            <td>
                <fmt:formatDate value="${hkShopUserOrderWithraw.delivertime}" pattern="yyyy-MM-dd"/>
            </td>
            <td>
                <fmt:formatDate value="${hkShopUserOrderWithraw.confirmdate}" pattern="yyyy-MM-dd"/>
            </td>
            <td>
                    ${fns:getDictLabel(hkShopUserOrderWithraw.afterstate, 'hk_shop_order_afterState', '')}
            </td>
            <shiro:hasPermission name="shop:shop:hkShopUserOrderWithraw:edit">
                <td>
                    <c:if test='${"0" eq hkShopUserOrderWithraw.isWithdraw}'>
                        <%--<a id="state3" href="javascript:"
                           onclick="updateWithrawByOrderNumber('${hkShopUserOrderWithraw.ordernumber}')"
                           style="color: red;">申请提现</a>--%>
                        <a href="${ctx}/shop/shop/hkShopUserOrderWithraw/updateWithrawByOrderNumber?orderNumber=${hkShopUserOrderWithraw.ordernumber}">
                            <font color="red">申请提现</font>
                        </a>
                    </c:if>
                    <c:if test='${"1" eq hkShopUserOrderWithraw.isWithdraw}'>
                        <font color="black">提现处理中...</font>
                    </c:if>
                    <c:if test='${"2" eq hkShopUserOrderWithraw.isWithdraw}'>
                        <font color="black">提现成功</font>
                    </c:if>
                    <c:if test='${"3" eq hkShopUserOrderWithraw.isWithdraw}'>
                        <font color="black">提现时间未到</font>
                    </c:if>
                    <c:if test='${"4" eq hkShopUserOrderWithraw.isWithdraw}'>
                        <font color="black">订单已申请退款</font>
                    </c:if>
                </td>
            </shiro:hasPermission>
        </tr>
    </c:forEach>
    </tbody>
</table>
<div class="pagination">${page}</div>
</body>
</html>